#include <stdio.h>
#include <stdlib.h>

typedef int DataType;
typedef struct node
{
    DataType data;
    struct node *next;
} ListNode;

typedef ListNode *LinkList;
ListNode *p;
LinkList head1;

typedef struct dlnode
{
    DataType data;
    struct dlnode *prior, *next;
} DLNode;

typedef DLNode *DLinkList;
DLinkList head2;

void f34(LinkList head1, DLinkList *head2);

int fibo(int n)
{
    if (n == 0)
        return 0;
    if (n == 1)
        return 1;
    return fibo(n - 1) + fibo(n - 2);
}

void main()
{
    int s = fibo(4);
    printf("%d\n", s);
}

void f34(LinkList head1, DLinkList *head2)
{
    LinkList temp = head1;
    DLNode *pre = NULL;
    while (temp != NULL)
    {
        DLNode *dl = (DLNode *)malloc(sizeof(DLNode));
        dl->data = temp->data;
        dl->next = NULL;
        dl->prior = pre;

        if (*head2 == NULL)
        {
            *head2 = dl;
            pre = dl;
        }
        else
        {
            pre->next = dl;
            pre = dl;
        }
        temp = temp->next;
    }
}